/*
 * Created by JFormDesigner on Tue Apr 17 15:43:35 EEST 2012
 */

package tr.gov.tubitak.bilgem.esya.crlviewer;

import sun.security.action.OpenFileInputStreamAction;

import javax.swing.*;
import java.io.File;

/**
 * @author Haydar Karabas
 */
public class ECRLPanel extends JPanel {
    public ECRLPanel() {
        initComponents();
    }

   public void loadCrl(File crlFile){
        EViewerCRL viewerCRL = ECrlUtil.loadCrl(crlFile.getPath());
       loadCrl(viewerCRL);

    }

    void loadCrl(EViewerCRL viewerCRL){
        if(viewerCRL==null){
            return;
        }
        ECrlGeneralInfoPanel generalInfoPanel = new ECrlGeneralInfoPanel(viewerCRL);
        tabPaneCrlDetail.add(Bundle.getString("ECRLPanel.genel"),generalInfoPanel);

        ECrlRevokedCertsPanel revokedCertsPanel = new ECrlRevokedCertsPanel(viewerCRL);
        tabPaneCrlDetail.add(Bundle.getString("ECRLPanel.iptalListesi"),revokedCertsPanel);
    }

    public void loadCrl(byte [] crlValue){
        EViewerCRL viewerCRL = ECrlUtil.loadCrl(crlValue);
        loadCrl(viewerCRL);
    }


    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        tabPaneCrlDetail = new JTabbedPane();

        //======== this ========
        setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
        add(tabPaneCrlDetail);
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    private JTabbedPane tabPaneCrlDetail;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
}
